package com.kexinde.wjifen.model;

import java.sql.Timestamp;

import javax.persistence.Entity;

/**
 * 商店礼品
 * 
 * @author WEI
 *
 */
@Entity
public class ShopProduct {

	/**
	 * 主键
	 */
	private Long id;
	
	/**
	 * 礼品名称
	 */
	private String name = "";
	
	/**
	 * 兑换礼品所需的积分
	 */
	private Long point = 0L;
	
	/**
	 * 礼品原价
	 */
	private Double oldPrice = 0.0;
	
	/**
	 * 此礼品已兑换的次数
	 */
	private Integer amount = 0;
	
	/**
	 * 礼品描述
	 */
	private String profile = "";
	
	/**
	 * 礼品图片路径
	 */
	private String pic = "";
	
	/**
	 * 商店id，外键
	 */
	private Long shopId;
	
	/**
	 * 创建时间
	 */
	private Timestamp insTime;

	
	/**
	 * 构造方法
	 * 动态创建实例，用于数据库读写时，反射获取对象
	 * @param id
	 * @param name
	 * @param point
	 * @param oldPrice
	 * @param amount
	 * @param profile
	 * @param pic
	 * @param shopId
	 * @param insTime
	 */
	public ShopProduct(Long id, String name, Long point, Double oldPrice,
			Integer amount, String profile, String pic, Long shopId,
			Timestamp insTime) {
		this.id = id;
		this.name = name;
		this.point = point;
		this.oldPrice = oldPrice;
		this.amount = amount;
		this.profile = profile;
		this.pic = pic;
		this.shopId = shopId;
		this.insTime = insTime;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getPoint() {
		return point;
	}

	public void setPoint(Long point) {
		this.point = point;
	}

	public Double getOldPrice() {
		return oldPrice;
	}

	public void setOldPrice(Double oldPrice) {
		this.oldPrice = oldPrice;
	}

	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	public String getProfile() {
		return profile;
	}

	public void setProfile(String profile) {
		this.profile = profile;
	}

	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	public Long getShopId() {
		return shopId;
	}

	public void setShopId(Long shopId) {
		this.shopId = shopId;
	}
	
	/**
	 * 用于测试
	 */
	@Override
	public String toString() {
		return "ShopProduct [id=" + id + ", name=" + name + ", point=" + point
				+ ", oldPrice=" + oldPrice + ", amount=" + amount
				+ ", profile=" + profile + ", pic=" + pic + ", shopId="
				+ shopId + "]";
	}

	public Timestamp getInsTime() {
		return insTime;
	}

	public void setInsTime(Timestamp insTime) {
		this.insTime = insTime;
	}
	
}
